package com.jinzhi.jinzhidata.dataobject;

import lombok.Data;
import lombok.ToString;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @author vansl
 * @description
 * @date 2019-12-29 12:56
 **/
@Data
@EntityListeners(AuditingEntityListener.class)
@Entity
@ToString
public class Resource {

    @Id
    private String resourceId;

    private String resourceCover;

    private String resourceName;

    private String resourceFileName;

    private String resourceIntroduction;

    /**
     * 单位为人民币元
     */
    private BigDecimal resourcePrice;

    private String resourceTypeId;

    @Lob
    @Basic(fetch = FetchType.LAZY)
    private String resourceDetail;

    private String resourceState;

    private String resourceAuthorId;

    @CreatedDate
    private Date createTime;

    @LastModifiedDate
    private Date updateTime;
}
